function myAjax(url, data, type) {
    let temp = null;
    data.append("token", $.cookie("token"));
    $.ajax({
        url: 'http://localhost:8088' + url,
        data: data,
        type: type,
        async: false,
        xhrFields: {
            withCredentials: true //允许跨域带Cookie
        },
        dataType: 'json',
        success: function (data) {
            temp = data;
        }
    })
    return temp;
}

function myImgAjax(url, data, type) {
    let temp = null;
    // data.username=localStorage.getItem("username");
    data.append("token", $.cookie("token"));
    // console.log(data.token)
    $.ajax({
        url: 'http://localhost:8088' + url,
        data: data,
        type: type,
        async: false,
        xhrFields: {
            withCredentials: true //允许跨域带Cookie
        },
        contentType: false,
        processData: false,
        dataType: 'json',
        success: function (data) {
            temp = data;
        }
    })
    return temp;
}
